import 'package:ls_work/a_elder/models/elder_entity.dart';

class ElderGridEntity {
  List<ElderGridFloorEntity>? data;

  ElderGridEntity({this.data});

  factory ElderGridEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['data'] as List?;
    List<ElderGridFloorEntity> protocolList = (originList??[])
        .map((value) => ElderGridFloorEntity.fromJson(value))
        .toList();
    return ElderGridEntity(data: protocolList);
  }
}

class ElderGridFloorEntity {
  int? buildingId;
  String? buildingNo;
  List<ElderGridFloorElderEntity>? elderFloorBeanList;

  ElderGridFloorEntity({this.elderFloorBeanList, this.buildingId,this.buildingNo});

  factory ElderGridFloorEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['elderFloorBeanList'] as List?;
    List<ElderGridFloorElderEntity> protocolList = (originList??[])
        .map((value) => ElderGridFloorElderEntity.fromJson(value))
        .toList();
    return ElderGridFloorEntity(
      buildingId: json["buildingId"],
      buildingNo: json["buildingNo"],
      elderFloorBeanList: protocolList,
    );
  }
}

class ElderGridFloorElderEntity {
  final String? floorNo;
  List<ElderInfo>? customerElderBeanList;

  ElderGridFloorElderEntity({this.customerElderBeanList, this.floorNo});

  factory ElderGridFloorElderEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['customerElderBeanList'] as List?;
    List<ElderInfo>? protocolList =
        (originList??[]).map((value) => ElderInfo.fromJson(value)).toList();
    return ElderGridFloorElderEntity(
        customerElderBeanList: protocolList, floorNo: json['floorNo']);
  }
}
